#include "FireGun.h"
#include "../../../SGD_Wrappers/CSGD_EventSystem.h"
#include "../../../SGD_Wrappers/Message.h"
#include "../../CreateFirePrim.h"
#include "../../../SGD_Wrappers/CSGD_MessageSystem.h"

CFireGun::CFireGun(void)
{
	m_nEnergyCostShot1 = 15;
}

CFireGun::CFireGun(CPlayer* pOwner)
{
	m_pOwner = pOwner;
	m_nEnergyCostShot1 = 15;
}

CFireGun::~CFireGun(void)
{
}

void CFireGun::Shoot()
{
	if(m_pOwner->GetEnergy() >= m_nEnergyCostShot1)
	{
		CSGD_EventSystem* pES = CSGD_EventSystem::GetInstance();
		pES->SendEvent("DRAIN_ENERGY",(void*)m_nEnergyCostShot1,nullptr,this);

		IMessage* i = new CCreateFirePrim( m_pOwner );
		CSGD_MessageSystem::GetInstance()->SendMsg( i );
		i = nullptr;
	}
}
void CFireGun::Render()
{

}
void CFireGun::Update(float fElapsedTime)
{

}
void CFireGun::AddRef()
{

}
void CFireGun::Update()
{

}
RECT CFireGun::GetRect()
{
	return CEntity::GetRect();
}

void CFireGun::HandleEvent(CEvent* pEvent)
{

}